﻿// Example header text. Can be configured in the options.
using System;
using System.Data;
using vtech_formBase;

namespace PharmacySystem.BusinessObjectCategory
{
    public partial class frmEditBusinessObjectCategory : frmEdit
    {
        public delegate void EditDelegate();
        public event EditDelegate OnEdit = null;

        protected override void FireEvent()
        {
            if (this.OnEdit != null)
            {
                this.OnEdit();
            }
        }

        public frmEditBusinessObjectCategory(Guid ID)
        {
            this.InitializeComponent();
            this.ID = ID;
        }

        public frmEditBusinessObjectCategory()
        {
            this.InitializeComponent();
        }

        protected override void GetData()
        {
            ClsBusinessObjectCategoryDAO obj = new ClsBusinessObjectCategoryDAO();
            DataRow[] drow;
            drow = obj.GetAll().Select(string.Format("ID='{0}'", this.ID));
            foreach (DataRow row in drow)
            {
                this.txtBusinessCode.Text = row["Code"].ToString();
                this.txtBusinessName.Text = row["Name"].ToString();
                this.txtDescription.Text = row["Description"].ToString();
            }
        }
    }
}